package com.ee.chat.common.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ee.chat.common.entity.UserRechargeLog;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * <p>
 * Mapper接口
 * </p>
 *
 * @author Shane
 * @since 2019-08-22
 */
public interface UserRechargeLogMapper extends BaseMapper<UserRechargeLog> {
    /**
     * 获取充值记录
     * @Author Shane
     * @Date 2019/8/2217:39
     * @param
     * @return
     **/
    IPage<Map<String, Object>> getRechagerLog(Page page, @Param("userId") Integer userId);

    /**
     * 根据订单号查询充值记录
     * @Author Shane
     * @Date 2019/10/5 5:06
     * @param
     * @return
     */
    UserRechargeLog selectByOrderNumber(@Param("orderNumber") String orderNumber);

    /**
     * 用户充值明细
     * @Author Shane
     * @Date 2019/10/28 23:55
     * @param
     * @return
     */
    IPage<Map<String, Object>> list(Page page, @Param("userId") Integer userId, @Param("type") Integer type,
                                    @Param("beginTime") Date beginTime, @Param("endTime") Date endTime);

    /**
     * 获取用户充值次数
     * @Author Shane
     * @Date 2020/2/2 13:59
     * @param
     * @return
     */
    int getUserRechargeCount(@Param("userId") Integer userId);

    /**
     * 获取用户优质充值记录次数
     * 充值金额大于88元的行为超过5次即为优质用户
     * @Author Shane
     * @Date 2020/9/3 13:21
     * @param
     * @return
     */
    int getUserHighRechargeLogCount(@Param("userId") Integer userId);
}